//
//  UIImageView+XYExtension.swift
//  Swift-WB
//
//  Created by lxy on 2017/6/14.
//  Copyright © 2017年 lixiya. All rights reserved.
//

import Foundation
import UIKit
import Kingfisher

extension UIImageView {

    func xy_setImage(urlStr:String?, placeholder:UIImage?) {
        guard let urlStr = urlStr,
            let url = URL(string: urlStr) else {
                self.image = placeholder
                return
        }
        self.kf.setImage(with: url, placeholder: placeholder, options: [.transition(ImageTransition.fade(1))], progressBlock: nil, completionHandler: nil)
    }
}
